package com.mxwl.cbg.common.model.base;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum Gemstone {
    GloryStone("光芒石", new String[]{"铠甲", "腰带"}, "气血", 40),
    SunStone("太阳石", new String[]{"武器", "头盔"}, "伤害", 8),
    MoonStone("月亮石", new String[]{"铠甲", "头盔"}, "防御", 12),
    BlackGem("黑宝石", new String[]{"腰带", "鞋子"}, "速度", 8),
    RedAgate("红玛瑙", new String[]{"武器", "头盔"}, "命中", 25),
    SheliZi("舍利子", new String[]{"铠甲", "饰品"}, "灵力", 6),
    MysticStone("神秘石", new String[]{"武器", "腰带", "鞋子"}, "躲避力", 20),
    JadeStone("翡翠石", new String[]{"铠甲"}, "法术防御力", 12);

    @Getter
    private final String chineseName; // 中文名

    @Getter
    private final String[] applicableEquipments; // 可以镶嵌该宝石的装备列表

    @Getter
    private final String attribute; // 加成的属性

    @Getter
    private final int value; // 加成的数值


    // 根据英文名获取对应的枚举值
    public static Gemstone fromEnglishName(String name) {
        for (Gemstone gem : values()) {
            if (gem.getChineseName().equalsIgnoreCase(name)) {
                return gem;
            }
        }
        throw new IllegalArgumentException("No gemstone found with English name: " + name);
    }
}